home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / me_cd25.zip / MUTT2.ZIP / RUNBLOCK.MUT < prev    next >
Text File  |  1992-11-09  |  862b  |  30 lines

  1. ;; run-pgm-on-block: Run a pgm on each line in a block.
  2. ;; A user defined program is called for each line in block.
  3. ;; Input:
  4. ;;   A pointer to a pgm that does something to the current line.  The program
  5. ;;   SHOULD NOT delete lines or add lines and should remain on the current
  6. ;;   line (or at least be there when it returns).
  7. ;; pgm knows:
  8. ;;   That the point is at the start of the line.
  9. ;;   All the args passed to run-pgm-on-block have been passed to it.
  10. ;; C Durland 4/89    Public Domain
  11.  
  12. (include me2.h)
  13.  
  14. (defun
  15.   run-pgm-on-block (pointer defun pgm) HIDDEN
  16.   {
  17.     (byte type)(small-int left-edge width height)(int size)    ;; RegionInfo
  18.  
  19.     (region-stats (loc type) THE-DOT THE-MARK TRUE)
  20.  
  21.     (beginning-of-line)
  22.     (while (!= 0 height)
  23.     {
  24.       (pgm (push-args 1))
  25.       (forward-line 1)
  26.       (-= height 1)
  27.     })
  28.   }
  29. )
  30.